#ifndef _CLOCK_
#define _CLCOK_

#include <time.h>
#include "Buffer.h"

char* Get_Time_Stamp();

#ifndef _PAGE_
#define _PAGE_

//A page is a date and an entry
// Since pages are linked, they also know the previous and next pages
typedef struct _Page
{
	struct _BUFFER * m_BText;
	struct _BUFFER * m_BStamp;
	struct _Page * PrevPage;
	struct _Page * NextPage;
} Page;

#ifndef _BOOK_
#define _BOOK_

//The book holds a dynamic array of pages and links them all together
typedef struct _Book
{
	struct _Page* Pages;
	struct _Page* CurrentPage;
} Book;

#endif
#endif
#endif

void Book_Init(struct _Book * B);

struct _Book * Book_Create();

struct _Page * Page_New();

struct _Page * Page_NewA( struct _Page * NextP,struct _Page * PrevP);

void Time_Print();

void Book_CheckPages(struct _Book * B);

void Book_Add_Entry_Interface(struct _Book * B);

	//**				**//
//** Entry # 1 Week 3 Begin **//
	//**				**//
//What was added

//struct _Page * Page_Make_New( char * a_BText , struct _Page * NextP, struct _Page * PrevP );

struct _Page * Page_Make_New( struct _BUFFER * a_BText , struct _Page * NextP, struct _Page * PrevP );

void Book_Add_Entry(struct _Book * B, struct _BUFFER * a_BText);

void Book_Add_Entry_Time(struct _Book * B, struct _BUFFER * a_BText,struct _BUFFER * a_BTime);

//What was removed
//struct _Page * Page_Make_New( char* Text , struct _Page * NextP, struct _Page * PrevP );
//
//void Book_Add_Entry(struct _Book * B, char * Text);
//
//void Book_Add_Entry_Time(struct _Book * B, char * Text,char * Time);

	//**				**//
//** Entry # 2 Week 2 End **//
	//**				**//

void Book_Remove_Page(struct _Book * B,struct _Page * P);

void Book_Interface(struct _Book * B);

void Book_Print_Page_Interface(struct _Book * B);

void Book_Print_Current_Page(struct _Book * B);

void Book_Print_All(struct _Book * B);

void Book_Save(struct _Book * B);

void Book_Save_Specific(struct _Book * B, char * BookName, char * ColorName);

void Save_To_Book(struct _Book * B, char * BookName, char * ColorName);

struct _Book * Book_Load();

struct _Book * Book_Load_Specific(char * BookName, char * ColorName);

struct _Book * Open_Book(char * BookName, char * ColorName);

BOOLEAN CheckPassword(struct _BUFFER * Password);